import request from '../request'
import type { NotificationQueryDTO, NotificationVO } from '@/types/notification'
import type { PageResult } from '@/types/api'

export const notificationApi = {
  // 分页查询通知
  getNotifications: (query: NotificationQueryDTO, page: number, size: number) => {
    return request<PageResult<NotificationVO>>({
      url: '/v1/notifications/page',
      method: 'get',
      params: { ...query, page, size }
    })
  },

  // 标记通知为已读
  markAsRead: (id: number) => {
    return request({
      url: `/v1/notifications/${id}/read`,
      method: 'put'
    })
  },

  // 删除通知
  deleteNotification: (id: number) => {
    return request({
      url: `/v1/notifications/${id}`,
      method: 'delete'
    })
  }
} 